<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/12/17
 * Time: 10:15
 */
namespace app\index\model;

use think\Model;

class Member extends Model
{

    protected $table = "duck_member_user";

    protected $autoWriteTimestamp = true;

    public function getStatusAttr($value)
    {
        $status = [1=>['status'=>'顾客','bool'=>false],2=>['status'=>'服务员','bool'=>true],3=>['status'=>'厨师','bool'=>true]];
        return $status[$value];
    }
    public function getSexAttr($value)
    {
        $status = [0=>'未知',1=>'男',2=>'女'];
        return $status[$value];
    }

    public function team(){
        return $this->hasOne('memberTeam','user_id','id');
    }

}